package org.dei.perla.sys.device.fpc;

import java.util.ArrayList;

public class PerlaDataTransform {

	public static double linear(int adc_value, Double[] coefficients) throws PerlaDataTransformException {
		double retValue;
		if(coefficients == null){
			throw new PerlaDataTransformException("coeficients passed are null");
		}
		if(coefficients.length < 2){
			throw new PerlaDataTransformException("coeficients vector length is " + coefficients.length +" but expected 2");	
		}
		retValue = coefficients[0] + coefficients[1] * ((double) adc_value);
		return retValue;
	}

}
